package com.dayuanit.dy16.atm.boatm.mapper;

import com.dayuanit.dy16.atm.boatm.entity.Permission;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PermissionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    List<Permission> listPermission(@Param("parentId") Long parentId,
                                    @Param("leaf") Integer leaf,
                                    @Param("menu") Integer menu);

    int insertRolePermission(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    int delRolePermission(Long roleId);

    List<Permission> listByRoleId(Long roleId);

    List<Permission> listMenuByUserId(Long userId);

    int batchRolePermission(@Param("roleId") Long roleId, @Param("permissionIds") List<Long> permissionIds);

}